/*******************************************************************************
 * Copyright (c) 2011-11-10 @author <a href="mailto:iffiff1@hotmail.com">Tyler Chen</a>.
 * All rights reserved.
 *
 * Contributors:
 *     <a href="mailto:iffiff1@hotmail.com">Tyler Chen</a> - initial API and implementation
 ******************************************************************************/
package com.redhat.auth.ejb.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * @author <a href="mailto:iffiff1@hotmail.com">Tyler Chen</a> 
 * @since 2011-11-10
 */
public class AccountVO implements Serializable {

	private static final long serialVersionUID = -6941385773217564385L;

	private Long id;
	// 账户名
	private String username;

	private String password;

	private String newPassword;

	// 真实姓名
	private String realName;

	// 电子邮件
	private String email;

	// 注册日期
	private Date registryDate;

	// 是否被锁定
	private Boolean locked;

	// 最后的密码修改日期
	private Date passwordLastUpdateDate;

	// 描述
	private String description;

	private Set<RoleVO> roles = new HashSet<RoleVO>();

	private Set<BizSystemBindingVO> bizSystemBindings = new HashSet<BizSystemBindingVO>();

	public AccountVO() {
		super();
	}

	public AccountVO(Long id, String username, String password,
			String realName, String email, Date registryDate, Boolean locked,
			Date passwordLastUpdateDate, String description, Set<RoleVO> roles,
			Set<BizSystemBindingVO> bizSystemBindings) {
		this();
		this.id = id;
		this.username = username;
		this.password = password;
		this.realName = realName;
		this.email = email;
		this.registryDate = registryDate;
		this.locked = locked;
		this.passwordLastUpdateDate = passwordLastUpdateDate;
		this.description = description;
		this.roles = roles;
		this.bizSystemBindings = bizSystemBindings;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getRegistryDate() {
		return registryDate;
	}

	public void setRegistryDate(Date registryDate) {
		this.registryDate = registryDate;
	}

	public Boolean getLocked() {
		return locked;
	}

	public void setLocked(Boolean locked) {
		this.locked = locked;
	}

	public Date getPasswordLastUpdateDate() {
		return passwordLastUpdateDate;
	}

	public void setPasswordLastUpdateDate(Date passwordLastUpdateDate) {
		this.passwordLastUpdateDate = passwordLastUpdateDate;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Set<RoleVO> getRoles() {
		return roles;
	}

	public void setRoles(Set<RoleVO> roles) {
		this.roles = roles;
	}

	public Set<BizSystemBindingVO> getBizSystemBindings() {
		return bizSystemBindings;
	}

	public void setBizSystemBindings(Set<BizSystemBindingVO> bizSystemBindings) {
		this.bizSystemBindings = bizSystemBindings;
	}

	public String getNewPassword() {
		return newPassword;
	}

	public void setNewPassword(String newPassword) {
		this.newPassword = newPassword;
	}

	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
